import { ShellUtil } from "./ShellUtil";
import { Main } from "../Main";

/**
 * bugly符号表生成工具
 */
export class BuglySymbolUtil {
    static exec(cb:()=>void) {
        let sh = `${Main.projPath}easyscript/lib/buglySymbolAndroid2.6.3/buglySymbolAndroid.sh`;
        let objlocal = `${Main.codePath}frameworks/runtime-src/proj.android/obj/local/`;
        ShellUtil.spawn(sh, ["-i", objlocal], ()=>{
            ShellUtil.exec(`
mv -f ${Main.codePath}frameworks/runtime-src/proj.android/obj/buglySymbol* ${Main.projPath} || exit 1
            `,()=>{
                console.log("符号表生成完成，文件在",Main.projPath);
                cb();
            });
        });
    }
}